#include <my_header.h>

#include "usrchart.h"



char*saltInit(){
    srandom(time(NULL));
    char elems[128] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./";
    char *salt = (char*)calloc(21,sizeof(char));
    salt[0] = '$';
    salt[1] = '6';
    salt[2] = '$';
    for(int curidx = 3; curidx < 19; curidx++){
        char elem = elems[random() % 64];
        salt[curidx] = elem;
    }
    salt[19] = '$';
    salt[20] = '\0';
    //printf("salt = %s\n",salt);
    return salt;
}
